Skip to content

Conversation

@clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Dec 18, 2025

In #669, a method marked pub had to be changed to pub(crate) in order to satisfy MSRV. Essentially, MSRV is not smart enough to determine that a method marked pub which is actually inaccessible outside the crate is not leaking private types, and so, we need to fix this.

I decided to automatically fix all instances of the unreachable_pub lint since, although MSRV does not have this lint, it could benefit from this change in the future, and it's better to make the changes now than have to sprinkle them occasionally later. I also see no need to permanently try and catch the lint in CI, since this is only a theoretically useful change. (Also, it has a few false positives, like changing Bucket to pub(crate) not being allowed due to being present in public trait implementations, despite the type itself not being public.)

@Amanieu
Copy link
Member

Amanieu commented Dec 21, 2025

I would prefer if we did actually enable unreachable_pub by default so we avoid introducing incorrect new uses of pub in the future. We can manually #[allow] the few places that need it due to false positives.

@clarfonthey
Copy link
Contributor Author

That won't cause issues with deny(warnings) on CI? My main concern is that the lint doesn't exist in the MSRV, so, we'd end up failing due to an unknown lint anyway.

@Amanieu
Copy link
Member

Amanieu commented Dec 22, 2025

As per the discussion in #650 we should be able to raise MSRV to 1.84 at least.

@clarfonthey
Copy link
Contributor Author

clarfonthey commented Dec 23, 2025

I'll do that in a separate PR, then, and add this afterward, so that the update for MSRV can come with various clippy fixes as well.

(Edition is 1.85, so, not that though.)

@Amanieu Amanieu added this pull request to the merge queue Dec 23, 2025
Merged via the queue into rust-lang:master with commit 1f5b7b8 Dec 23, 2025
25 checks passed
@clarfonthey
Copy link
Contributor Author

Wrong order, but I can update my MSRV PR 😅

@clarfonthey clarfonthey deleted the unreachable-pub branch December 23, 2025 21:50
@clarfonthey clarfonthey mentioned this pull request Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants